package cn.wongshu.student.pojo;

import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

@Data
@Table(name = "goods")
public class Goods {

    @Id
    private Integer id;

    private String name;

    private Integer delFlag;

    private Date createDate;

    private Date updateDate;

    private Integer categoryId;

    private String categoryName;//分类名称

    private String intro;//商品简介

    //扩展字段
    @Transient
    private String enabledValue;

    public void setDelFlag(Integer delFlag) {

        this.delFlag = delFlag;
        this.enabledValue = delFlag == 1 ? "否":"是";
    }



}
